import axios from 'axios'

export default class  {
   
    //添加零星劳务单
    Addfragmentary(apply,projectId,empId){
        return axios.get(`http://localhost/smj_fragmentary`,{
            params:{
                'apply_date':apply.apply_date,
                'p_id':projectId,
                'type':apply.type,
                'handler_id':empId,
                'comment':apply.comment,
                'attach_ids':apply.attach_ids,
            }
        })
    }

    //添加工程量信息
    AddWorkList(tenderPurchaseDetails,id){
        return axios.get(`http://localhost/smj_fragmentary/AddWorkList`,{
            params:{
                'fragmentary_id':id,
                'work_content':tenderPurchaseDetails.work_content,
                'unit':tenderPurchaseDetails.unit,
                'unit_price':tenderPurchaseDetails.unit_price,
                'number':tenderPurchaseDetails.number,
            }
        })
    }

    //审批
    FlowFragmentary(apply){
        return axios.post(`http://localhost/smj_fragmentary/Flow_Fragmentary`,apply)
    }

    //查看零星劳务列表
    ListFragmentary(params){
        return axios.get(`http://localhost/smj_fragmentary/ListFragmentary`,{
            params:params
        })
    }

    //零星劳务工程量清单
    getWorkList(id){
        return axios.get(`http://localhost/smj_fragmentary/getWorkList`,{
            params:{
                'fragmentary_id':id
            }
        })
    }

    //获取审批流程
    getfromaudit(id){
        return axios.get(`http://localhost/smj_fragmentary/getfromaudit`,{
            params:{
                'id':id
            }
        })
    }
}